package com.etc.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.etc.entity.Orders;
import com.etc.entity.User;

@Repository
public interface OrderMapper {

	// @Insert("insert into ")
	int insert(Orders record);

	int deleteByPrimaryKey(Integer orderid);

	int insertSelective(Orders record);

	Orders selectByPrimaryKey(Integer orderid);

	int updateByPrimaryKeySelective(Orders record);

	int updateByPrimaryKey(Orders record);

	// @Results(id = "orderMap", value = {
	// @Result(property="orderid", column="orderid"),
	// @Result(property="orderno", column="orderno"),
	// @Result(property="user", column="userid",
	// one=@One(select="com.etc.mapping.UserMapper.selectByPrimaryKey")),
	// @Result(property="orderprice", column="orderprice"),
	// @Result(property="orderstatus", column="orderstatus"),
	// @Result(property="attid", column="orderid"),
	// @Result(property="orderdate", column="orderdate"),
	// })
	// @Select("select orderno from orders where orderno like '#{content}' limit
	// #{start}, #{pageSize}")
	List<Orders> selectAllByPage(@Param("start") int start, @Param("pageSize") int pageSize,
			@Param("content") String content);

	int selectCount(@Param("content") String content);

	List<Orders> selectByPage(int start, int limit, String content, int userid);

	int selectCountByUserid(String content, int userid);
}